using Microsoft.EntityFrameworkCore;
using TodoApi.Domain;
using TodoApi.IRepository;

var builder = WebApplication.CreateBuilder(args);

var connectionString = builder.Configuration.GetConnectionString("mysql");
builder.Services.AddDbContext<AdminDbContext>(x => 
{
    x.UseMySql(connectionString,ServerVersion.AutoDetect(connectionString));
});

builder.Services.AddScoped(typeof(IRepository<>), typeof(EfRepository<>));

builder.Services.AddControllers();


var app = builder.Build();


app.MapControllers();
app.Run();

